home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16210 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  56 lines

  1. Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.lang.c++
  2. Path: indra.com!usenet
  3. From: tjv@indra.com (Tom Vilot)
  4. Subject: Re: Linked Lists
  5. Message-ID: <DpME74.2uF.0.server@indra.com>
  6. Sender: usenet@indra.com (System Operator)
  7. Organization: Indra's Net, Inc.
  8. Date: Wed, 10 Apr 1996 00:20:14 GMT
  9. References: <4k2kom$k5r@news2.cts.com> <31667AC8.4EE2@mindlink.bc.ca>
  10. X-Newsreader: Forte Free Agent 1.0.82
  11. X-Nntp-Posting-Host: net.indra.com
  12.  
  13. Blake Kadatz wrote:
  14.  
  15. >>   I would like to store all the objects in a linked list for a given window. 
  16.  
  17. >Have you tried CObList or CPtrList?  
  18.  
  19. These are some of the really nice parts of VC++/MFC. 
  20.  
  21. John, I'd recommend that you read up on these, and all their
  22. permutations (CMapStringToOb, CMapWordToOb, CMapWordToPtr, or whatever
  23. else there is...). They essentially implement linked lists and hash
  24. tables for you. Very sleek. Very easy to use. Very nice.
  25.  
  26. These list-based objects, as Blake indicated, do not do all kinds of
  27. "automatic" memory allocation/deallocation for you - but you *could*
  28. subclass one of them, or you could write your own object which
  29. utilizes one of these lists within itself, and does all the list
  30. access and memory management for you.
  31.  
  32. >> ...and return the pointer to the subclass that is allocating the objects
  33. >> on the linked list. 
  34.  
  35. I'm not entirely clear on what you mean here. Do you mean something
  36. like this?:
  37.  
  38. void CSomeObject::MakeNewListMember(CLinkedList *list)
  39. {
  40.  CMyObject    *object = new CMyObject;
  41.  CNewObject    *newObject = object->MakeANewGuy();
  42.  
  43.  list->AddToTail(newObject);
  44. }
  45.  
  46. ??
  47.  
  48.  
  49. +---------------------------------------------------------------+
  50. |  Thomas J. Vilot            ||               Digital Artist |
  51. |  Boulder, Colorado            ||         Multimedia Developer |
  52. |                                                  Photographer |
  53. |  <href="http://www.indra.com/~tjv/">                          |
  54. +---------------------------------------------------------------+
  55.  
  56.